<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html" template="../template_back.xhtml">
  
  <ui:define name="content">
     <h:form>

    <p:dataTable id="dataTable" var="c" value="#{clientController.clients}">
        <f:facet name="header"> Liste des clients </f:facet>
        
        <p:column  sortBy="#{c.login}" headerText="Login">
            <h:outputText value="#{c.login}"/>
        </p:column>
        
        <p:column sortBy="#{c.prenom}" headerText="Prénom">
            <h:outputText value="#{c.prenom}" />
        </p:column>
        
        <p:column sortBy="#{c.nom}" headerText="Nom">
            <h:outputText value="#{c.nom}" />
        </p:column>
        
        <p:column sortBy="#{c.adresse}" headerText="Adresse">
            <h:outputText value="#{c.adresse}" />
        </p:column>
        
        <p:column sortBy="#{c.email}" headerText="Email">
            <h:outputText value="#{c.email}" />
        </p:column>

		<p:column headerText="Editer">
	    	<h:commandButton value="Edit" action="#{clientController.editer}">
	    		<f:param name="clientId" value="#{c.id}"/>
			</h:commandButton>
		</p:column>
		
        <p:column headerText="Delete">
		 <h:commandButton action="#{clientController.delete}" value="Supprimer">
		 	<f:param name="clientId" value="#{c.id}"/>
		 </h:commandButton>
        </p:column>    
        
    </p:dataTable>

    <p:commandButton value="Ajouter un client" action="#{clientController.addClient}" />
 
	</h:form>
                     
  </ui:define>
</ui:composition>
